home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 July: Mac OS SDK / Dev.CD Jul 99 SDK1.toast / Development Kits / Mac OS / QuickTime / QuickTime 3 Interfaces & Libs / QTDevWin / CIncludes / DriverFamilyMatching.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-08-21  |  6.9 KB  |  216 lines  |  [TEXT/dosa]

  1. /*
  2.      File:        DriverFamilyMatching.h
  3.  
  4.      Contains:    Interfaces for create native drivers NDRV
  5.  
  6.      Version:    Technology:    
  7.                  Release:    QuickTime 3.0
  8.  
  9.      Copyright:    © 1995-1998 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. */
  18. #ifndef __DRIVERFAMILYMATCHING__
  19. #define __DRIVERFAMILYMATCHING__
  20.  
  21. #ifndef __MACTYPES__
  22. #include <MacTypes.h>
  23. #endif
  24. #ifndef __NAMEREGISTRY__
  25. #include <NameRegistry.h>
  26. #endif
  27. #ifndef __CODEFRAGMENTS__
  28. #include <CodeFragments.h>
  29. #endif
  30.  
  31.  
  32.  
  33. #if PRAGMA_ONCE
  34. #pragma once
  35. #endif
  36.  
  37. #ifdef __cplusplus
  38. extern "C" {
  39. #endif
  40.  
  41. #if PRAGMA_IMPORT
  42. #pragma import on
  43. #endif
  44.  
  45. #if PRAGMA_STRUCT_ALIGN
  46.     #pragma options align=mac68k
  47. #elif PRAGMA_STRUCT_PACKPUSH
  48.     #pragma pack(push, 2)
  49. #elif PRAGMA_STRUCT_PACK
  50.     #pragma pack(2)
  51. #endif
  52.  
  53. /*
  54.   ##############################################
  55.    Well known properties in the Name Registry
  56.   ##############################################
  57. */
  58.  
  59. #define kPropertyName                    "name"
  60. #define kPropertyCompatible                "compatible"
  61. #define    kPropertyDriverPtr                "driver-ptr"
  62. #define kPropertyDriverDesc                "driver-description"
  63. #define kPropertyReg                    "reg"
  64. #define kPropertyAAPLAddress            "AAPL,address"
  65. #define kPropertyMatching                "matching"
  66.  
  67. /* CPassThru */
  68. /*
  69.   #########################################################
  70.    Descriptor for Drivers and NDRVs
  71.   #########################################################
  72. */
  73. /* 
  74.     QuickTime 3.0: "DriverType" has a name collision with cross-platform code.
  75.     Use Mac prefix to avoid collision 
  76. */
  77. /* Driver Typing Information Used to Match Drivers With Devices */
  78.  
  79. struct MacDriverType {
  80.     Str31                             nameInfoStr;                /* Driver Name/Info String*/
  81.     NumVersion                         version;                    /* Driver Version Number*/
  82. };
  83. typedef struct MacDriverType            MacDriverType;
  84. #if TARGET_OS_MAC
  85.  
  86. typedef MacDriverType                     DriverType;
  87. #endif  /* TARGET_OS_MAC */
  88.  
  89. typedef MacDriverType *                    DriverTypePtr;
  90. /* OS Runtime Information Used to Setup and Maintain a Driver's Runtime Environment */
  91. typedef OptionBits                         RuntimeOptions;
  92.  
  93. enum {
  94.     kDriverIsLoadedUponDiscovery = 0x00000001,                    /* auto-load driver when discovered*/
  95.     kDriverIsOpenedUponLoad        = 0x00000002,                    /* auto-open driver when loaded*/
  96.     kDriverIsUnderExpertControl    = 0x00000004,                    /* I/O expert handles loads/opens*/
  97.     kDriverIsConcurrent            = 0x00000008,                    /* supports concurrent requests*/
  98.     kDriverQueuesIOPB            = 0x00000010,                    /* device manager doesn't queue IOPB*/
  99.     kDriverIsLoadedAtBoot        = 0x00000020,                    /* Driver is loaded at the boot time */
  100.     kDriverIsForVirtualDevice    = 0x00000040,                    /* Driver is for a virtual Device */
  101.     kDriverSupportDMSuspendAndResume = 0x00000080                /* Driver supports Device Manager Suspend and Resume command */
  102. };
  103.  
  104.  
  105. struct DriverOSRuntime {
  106.     RuntimeOptions                     driverRuntime;                /* Options for OS Runtime*/
  107.     Str31                             driverName;                    /* Driver's name to the OS*/
  108.     UInt32                             driverDescReserved[8];        /* Reserved area*/
  109. };
  110. typedef struct DriverOSRuntime            DriverOSRuntime;
  111. typedef DriverOSRuntime *                DriverOSRuntimePtr;
  112. /* OS Service Information Used To Declare What APIs a Driver Supports */
  113.  
  114. typedef UInt32                             ServiceCount;
  115.  
  116. struct DriverServiceInfo {
  117.     OSType                             serviceCategory;            /* Service Category Name*/
  118.     OSType                             serviceType;                /* Type within Category*/
  119.     NumVersion                         serviceVersion;                /* Version of service*/
  120. };
  121. typedef struct DriverServiceInfo        DriverServiceInfo;
  122. typedef DriverServiceInfo *                DriverServiceInfoPtr;
  123.  
  124. struct DriverOSService {
  125.     ServiceCount                     nServices;                    /* Number of Services Supported*/
  126.     DriverServiceInfo                 service[1];                    /* The List of Services (at least one)*/
  127. };
  128. typedef struct DriverOSService            DriverOSService;
  129. typedef DriverOSService *                DriverOSServicePtr;
  130. /* Categories */
  131.  
  132. enum {
  133.     kServiceCategoryDisplay        = FOUR_CHAR_CODE('disp'),        /* Display Manager*/
  134.     kServiceCategoryOpenTransport = FOUR_CHAR_CODE('otan'),        /* Open Transport*/
  135.     kServiceCategoryBlockStorage = FOUR_CHAR_CODE('blok'),        /* Block Storage*/
  136.     kServiceCategoryNdrvDriver    = FOUR_CHAR_CODE('ndrv'),        /* Generic Native Driver*/
  137.     kServiceCategoryScsiSIM        = FOUR_CHAR_CODE('scsi'),        /* SCSI */
  138.     kServiceCategoryFileManager    = FOUR_CHAR_CODE('file'),        /* File Manager */
  139.     kServiceCategoryIDE            = FOUR_CHAR_CODE('ide-'),        /* ide */
  140.     kServiceCategoryADB            = FOUR_CHAR_CODE('adb-'),        /* adb */
  141.     kServiceCategoryPCI            = FOUR_CHAR_CODE('pci-'),        /* pci bus */
  142.                                                                 /* Nu Bus */
  143.     kServiceCategoryDFM            = FOUR_CHAR_CODE('dfm-'),        /* DFM */
  144.     kServiceCategoryMotherBoard    = FOUR_CHAR_CODE('mrbd'),        /* mother Board */
  145.     kServiceCategoryKeyboard    = FOUR_CHAR_CODE('kybd'),        /* Keyboard */
  146.     kServiceCategoryPointing    = FOUR_CHAR_CODE('poit'),        /* Pointing */
  147.     kServiceCategoryRTC            = FOUR_CHAR_CODE('rtc-'),        /* RTC */
  148.     kServiceCategoryNVRAM        = FOUR_CHAR_CODE('nram'),        /* NVRAM */
  149.     kServiceCategorySound        = FOUR_CHAR_CODE('sond'),        /* Sound (1/3/96 MCS) */
  150.     kServiceCategoryPowerMgt    = FOUR_CHAR_CODE('pgmt'),        /* Power Management */
  151.     kServiceCategoryGeneric        = FOUR_CHAR_CODE('genr')        /* Generic Service Category to receive general Events */
  152. };
  153.  
  154. /* Ndrv ServiceCategory Types */
  155.  
  156. enum {
  157.     kNdrvTypeIsGeneric            = FOUR_CHAR_CODE('genr'),        /* generic*/
  158.     kNdrvTypeIsVideo            = FOUR_CHAR_CODE('vido'),        /* video*/
  159.     kNdrvTypeIsBlockStorage        = FOUR_CHAR_CODE('blok'),        /* block storage*/
  160.     kNdrvTypeIsNetworking        = FOUR_CHAR_CODE('netw'),        /* networking*/
  161.     kNdrvTypeIsSerial            = FOUR_CHAR_CODE('serl'),        /* serial*/
  162.     kNdrvTypeIsParallel            = FOUR_CHAR_CODE('parl'),        /* parallel */
  163.     kNdrvTypeIsSound            = FOUR_CHAR_CODE('sond'),        /* sound*/
  164.     kNdrvTypeIsBusBridge        = FOUR_CHAR_CODE('brdg')
  165. };
  166.  
  167.  
  168. typedef UInt32                             DriverDescVersion;
  169. /*    The Driver Description */
  170.  
  171. enum {
  172.     kInitialDriverDescriptor    = 0,
  173.     kVersionOneDriverDescriptor    = 1
  174. };
  175.  
  176.  
  177. enum {
  178.     kTheDescriptionSignature    = FOUR_CHAR_CODE('mtej'),
  179.     kDriverDescriptionSignature    = FOUR_CHAR_CODE('pdes')
  180. };
  181.  
  182.  
  183.  
  184. struct DriverDescription {
  185.     OSType                             driverDescSignature;        /* Signature field of this structure*/
  186.     DriverDescVersion                 driverDescVersion;            /* Version of this data structure*/
  187.     MacDriverType                     driverType;                    /* Type of Driver*/
  188.     DriverOSRuntime                 driverOSRuntimeInfo;        /* OS Runtime Requirements of Driver*/
  189.     DriverOSService                 driverServices;                /* Apple Service API Membership*/
  190. };
  191. typedef struct DriverDescription        DriverDescription;
  192. typedef DriverDescription *                DriverDescriptionPtr;
  193.  
  194.  
  195.  
  196. #if PRAGMA_STRUCT_ALIGN
  197.     #pragma options align=reset
  198. #elif PRAGMA_STRUCT_PACKPUSH
  199.     #pragma pack(pop)
  200. #elif PRAGMA_STRUCT_PACK
  201.     #pragma pack()
  202. #endif
  203.  
  204. #ifdef PRAGMA_IMPORT_OFF
  205. #pragma import off
  206. #elif PRAGMA_IMPORT
  207. #pragma import reset
  208. #endif
  209.  
  210. #ifdef __cplusplus
  211. }
  212. #endif
  213.  
  214. #endif /* __DRIVERFAMILYMATCHING__ */
  215.  
  216.